#pragma once


class CViewBase
{
public:
	virtual BOOL PreTranslateMessage(MSG* pMsg)
	{
		return FALSE;
	}

	virtual CWindow GetWindow() = 0;
	virtual HWND	GetHWND()	= 0;

	operator HWND() { return GetHWND(); }
};


template <class T>
class CChildView : public CViewBase
{
public:
	virtual CWindow GetWindow()
	{
		T* pT = static_cast<T*>(this);

		return CWindow(pT->m_hWnd);
	}

	virtual HWND GetHWND()
	{
		T* pT = static_cast<T*>(this);

		return pT->m_hWnd;
	}
};